<?php
include_once $_SERVER["DOCUMENT_ROOT"].'/service/entite/ResultatRechercheListe.php';
include_once $_SERVER["DOCUMENT_ROOT"].'/outils/database/Database.php';
include_once $_SERVER["DOCUMENT_ROOT"].'/outils/exceptions/DAOException.php';
include_once $_SERVER["DOCUMENT_ROOT"].'/service/entite/role/RoleEntite.php';
include_once $_SERVER["DOCUMENT_ROOT"].'/outils/string/StringUtils.php';

class RechercheRolePourListe {
	
	private function RechercheRolePourListe() {
		//évite la construction
	}
		
	public static function executer() {
		$database = Database::getInstance();
		$result = $database->executeQueryAndClose("SELECT id, libelle FROM role ORDER BY libelle");
		$resultArray = Array();
		foreach ($result as $row) {
			$resultatRecherche = new ResultatRechercheListe();
			$resultatRecherche->id = $row['id'];
			$resultatRecherche->libelle = $row['libelle'];
			$resultArray[] = $resultatRecherche;
		}
		return $resultArray;
	}
}
?>